
function fn1(){
    var oldArr = [5,  4,  26,  9,  4,  8,  5,  14];
    var newArr = [];
    for(var i=0; i<oldArr.length; i++){
        for(var j=0; j<newArr.length; j++){
            if(newArr[j] == oldArr[i]){
                break;
            }
        }
        if(j == newArr.length){
            newArr[j] = oldArr[i];
        }
    }
    console.log(newArr);
}
fn1();